package ai.plantdata.Behavior.mode.ObserverPattern.abstractClasses.impl;

import ai.plantdata.Behavior.mode.ObserverPattern.abstractClasses.Observer;
import ai.plantdata.Behavior.mode.ObserverPattern.classes.Subject;

/**
 * @Author: WangHui
 * @Date: 2020/12/23 15:24
 * @Description:
 */
public class HexaObserver extends Observer {

    public HexaObserver(Subject subject){
        this.subject = subject;
        this.subject.attach(this);
    }
    @Override
    public void update() {
        System.out.println("Hex String: " + Integer.toHexString( subject.getState()).toUpperCase());
    }
}
